<script type="text/javascript">
    $(function () {
        var jkrzcx = {
            gridOptions: {
                url: $.webPath() + "/sys/jkrzcx/logList",
                toolbar: "#jklog_toolbar",
                pagination: true,
                rownumbers: true,
                singleSelect: true,
                fit: true,
                fitColumns: true,
                columns: [
                    [
                        {field: 'clazz', title: '接口类别', align: 'center', width: 200},
                        {field: 'method', title: '方法名', align: 'center', width: 70},
                        {field: 'type', title: '类型', align: 'center', width: 70, formatter: function (value) {
                            return value == 'server' ? "服务端调用" : (value == 'client' ? '客户调用端' : "");
                        }},
                        {field: 'parameterData', title: '传递参数', width: 100, formatter: function (value, row, index) {
                            if (value.length <= 15)
                                return value;
                            else
                                return '<a title="传递参数" param="parameterData" class="jkrzcx_clob" href="javascript:void(0)" style="color:blue;" logId="' + row.id + '">' + value + '</a>';
                        }},
                        {field: 'returnData', title: '返回参数', width: 100, formatter: function (value, row, index) {
                            if (value) {
                                if (value.length <= 15)
                                    return value;
                                else
                                    return '<a title="返回参数" param="returnData" class="jkrzcx_clob" href="javascript:void(0)" style="color:blue;" logId="' + row.id + '">' + value + '</a>';
                            } else {
                                return "";
                            }
                        }},
                        {field: 'time', title: '调用日期', align: 'center', width: 100},
                        {field: 'exception', title: '异常信息', width: 100, formatter: function (value, row, index) {
                            if (value) {
                                if (value.length <= 15)
                                    return value;
                                else
                                    return '<a title="异常信息" param="exception" class="jkrzcx_clob" href="javascript:void(0)" style="color:blue;" logId="' + row.id + '">' + value + '</a>';
                            } else {
                                return "";
                            }
                        }}
                    ]
                ],
                onLoadSuccess: function () {
                    $("a.jkrzcx_clob").unbind("click").bind("click", function () {
                        var id = $(this).attr("logId");
                        var name = $(this).attr("param");
                        var title = $(this).attr("title");
                        $.post($.webPath() + '/sys/jkrzcx/getDetail', {id: id, clobName: name}, function (data) {
                            jkrzcx.showDialog(title, data);
                        });
                    })
                },
                queryParams: {
                    clazz: $("#jklog_toolbar [name='clazz']").val() || '',
                    method: $("#jklog_toolbar input[name='method']").val() || '',
                    type: $("#jklog_toolbar [name='type']").val() || '',
                    datetimeStart: $("#jklog_toolbar input[name='datetimeStart']").val() || '',
                    datetimeEnd: $("#jklog_toolbar input[name='datetimeEnd']").val() || '',
                    parameterData: $("#jklog_toolbar input[name='parameterData']").val() || '',
                    returnData: $("#jklog_toolbar input[name='returnData']").val() || ''
                }
            },
            grid: $("#jklog_datagrid"),
            win: null,
            init: function () {
                jkrzcx.grid.datagrid(jkrzcx.gridOptions);
            },
            showDialog: function (title, content) {
                jkrzcx.win = $.window({
                    title: title,
                    width: 870,
                    height: 470,
                    cache: false,
                    iconCls: 'icon-new',
                    contents: '<textarea style="width:96%;height:96%" readonly class="textarea" > ' + content + '</textarea>',
                    modal: true,
                    buttons: []
                });
            },
            search: function () {
                jkrzcx.grid.datagrid("reload", {
                    clazz: $("#jklog_toolbar [name='clazz']").val() || '',
                    method: $("#jklog_toolbar input[name='method']").val() || '',
                    type: $("#jklog_toolbar [name='type']").val() || '',
                    datetimeStart: $("#jklog_toolbar input[name='datetimeStart']").val() || '',
                    datetimeEnd: $("#jklog_toolbar input[name='datetimeEnd']").val() || '',
                    parameterData: $("#jklog_toolbar input[name='parameterData']").val() || '',
                    returnData: $("#jklog_toolbar input[name='returnData']").val() || ''
                })
            }
        };
        $(function () {
            jkrzcx.init();
            $("#jklog_toolbar input:button").click(function () {
                jkrzcx.search();
            });
        })
    });
</script>
<div class="easyui-layout" data-options="fit:true" style="width: 100%;height: 100%">
    <div data-options="region:'center'">
        <div id="jklog_toolbar">
            <div class="textcon">
                <table class="tb">
                    <tr>
                        <th>接口类别：</th>
                        <td>
                            <select class="easyui-combobox" name="clazz">
                                <option value="">全部</option>
                                <option value="com.hnkywl.sts.action.jhgl.SendPlanImport">计划导入接口</option>
                                <option value="com.hnkywl.sts.webservice.bg.impl.PlanBackService">计划退回</option>
                                <option value="com.hnkywl.sts.webservice.bg.impl.ContractForbidService">合同禁用接口</option>
                                <option value="com.hnkywl.sts.webservice.bg.impl.ContractService">合同同步接口</option>
                                <option value="com.hnkywl.sts.webservice.bg.impl.GoodsCodeService">物资编码接口</option>
                                <option value="com.hnkywl.sts.action.organ.GetBgProvide">供应商获取接口</option>
                                <option value="com.hnkywl.sts.service.cwgl.VoucherService">财务接口</option>
                            </select>
                        </td>

                        <th>方法名：</th>
                        <td><input name="method" type="text" class="input-text"></td>

                        <th>调用时间：</th>
                        <td>
                            <input name="datetimeStart" class="easyui-datetimebox" value="${datetimeStart!?datetime}"
                                   data-options="editable:false"/>
                            至
                            <input name="datetimeEnd" class="easyui-datetimebox" value="${datetimeEnd!?datetime}"
                                   data-options="editable:false"/>
                        </td>
                    </tr>
                    <tr>
                        <th>类型：</th>
                        <td>
                            <select class="easyui-combobox" name="type">
                                <option value="">全部</option>
                                <option value="server">服务端</option>
                                <option value="client">客户端</option>
                            </select>
                        </td>
                        <th>参数：</th>
                        <td><input name="parameterData" type="text" class="input-text"/></td>
                        <th>返回参数：</th>
                        <td><input name="returnData" type="text" class="input-text"/></td>
                        <td style=" padding-left:5px;"><input type="button" value="" class="submit"/></td>
                    </tr>
                </table>
            </div>
        </div>
        <table id="jklog_datagrid"></table>
    </div>
</div>



